package main
import (
	"fmt";
	"time"
)

func main(){
	timeObj:=time.Now()
	fmt.Println(timeObj)
	year:=timeObj.Year()
	month:=timeObj.Month()
	day:=timeObj.Day()
	hour:=timeObj.Hour()
	minute:=timeObj.Minute()
	second:=timeObj.Second()
	fmt.Printf("%d-%02d-%02d %02d:%02d:%02d\n",year,month,day,hour,minute,second)

	fmt.Println(timeObj.Format("2006-01-02 03:04:05"))

	fmt.Println(timeObj.Format("2006/01/02 15:04:05"))

	unixTime:=timeObj.Unix()
	fmt.Println(time.Unix(int64(unixTime),0))


	ticker:=time.NewTicker(time.Second)
	n:=5
	for val:=range ticker.C{
		 fmt.Println(val)
		 n--
		 if n==0{
			ticker.Stop()
			break;
		 }
	}

	fmt.Println("aaa")
	time.Sleep(time.Second)
	fmt.Println("bbb")

	for {
		time.Sleep(time.Second*2)
		fmt.Println("asas")
	}

}